const c_rich = {
    name: "c_rich",
    template: `<div class="c_rich" :class="{ capsule }" ref="c_rich" v-html="rich"></div>`,
    props: ["rich", "capsule"],
    mounted() {
        // 包含图片的标签，设置文本居中
        const children = this.$refs.c_rich.children;
        for (let i = 0; i < children.length; i++) {
            const item = children[i];
            for (let index = 0; index < item.children.length; index++) {
                const ele = item.children[index];
                if (ele.localName === "img") {
                    item.style.textAlign = "center";
                }
            }
        }
    }
}
Vue.component("c_rich", c_rich);